package com.njtoyo.taxi.admin.rest.wrapper.marketing.coupon;

import cn.hutool.core.date.DateTime;
import com.njtoyo.taxi.admin.mapper.master.enums.CouponCategory;
import com.njtoyo.taxi.admin.mapper.master.enums.CouponPlatform;
import com.njtoyo.taxi.admin.mapper.master.enums.CouponScope;
import com.njtoyo.taxi.admin.mapper.master.enums.CouponUsageCondition;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;

@Data
@ApiModel("优惠券")
public class CreateCouponWrapper {

    @ApiModelProperty(value = "优惠券类型：0:mix,1:reduction,2:fullreduction,3:discount")
    private CouponCategory couponCategory;

    @ApiModelProperty(value = "适用范围：0:mix,1:realtime,2:appointment")
    private CouponScope couponScope;

    @ApiModelProperty(value = "适用平台 0:mix[通用],1:app,2:wxmina[小程序],3:h5")
    private CouponPlatform couponPlatform;

    @NotNull(message = "couponDiscountType不能为空")
    @ApiModelProperty(value = "优惠券类型：0:reduction(减免),1:discount(折扣)")
    private Boolean couponDiscountType;

    @ApiModelProperty(value = "折扣或减免金额")
    private Double couponDiscountDigit;

    @ApiModelProperty(value = "使用条件(立减传null或不传！0:FULL-FULL_REDUCTION，1:MAX-DISCOUNT)")
    private CouponUsageCondition usageCondition;

    @ApiModelProperty(value = "使用限制")
    private String usageLimitDigit;

    @ApiModelProperty("开始时间，格式：yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private DateTime startedAt;

    @ApiModelProperty(value = "结束时间，格式：yyyy-MM - dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private DateTime endedAt;
}